package com.zh.custom.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;
import jakarta.validation.constraints.Size;

import java.io.Serial;
import java.util.Date;

/**
 * 客户处方表Entity
 * @author 690378361@163.com
 * @version 2025-08-31
 */
@Table(name="t_cus_presc", alias="a", label="客户处方表信息", columns={
		@Column(name="id", attrName="tid", label="主键", isPK=true),
		@Column(name="create_by", attrName="createBy", label="create_by", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="create_date", isUpdate=false, isQuery=false, isUpdateForce=true),
		@Column(name="update_by", attrName="updateBy", label="update_by", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="update_date", isQuery=false, isUpdateForce=true),
		@Column(name="business_date", attrName="businessDate", label="处方开立时间", isUpdateForce=true),
		@Column(name="create_dr_id", attrName="createDrId", label="创建医生工号"),
		@Column(name="create_dr_name", attrName="createDrName", label="创建医生姓名", queryType=QueryType.LIKE),
		@Column(name="presc_num", attrName="prescNum", label="处方编号"),
		@Column(name="cus_id", attrName="cusId", label="客户id"),
		@Column(name="stop_flag", attrName="stopFlag", label="停用标识"),
		@Column(name="del_flag", attrName="delFlag", label="删除标识"),
	}, orderBy="a.update_date DESC"
)
public class TcusPresc extends DataEntity<TcusPresc> {
	
	@Serial
	private static final long serialVersionUID = 1L;
	private Integer tid;		// 主键
	private Date businessDate;		// 处方开立时间
	private String createDrId;		// 创建医生工号
	private String createDrName;		// 创建医生姓名
	private String prescNum;		// 处方编号
	private String cusId;		// 客户id
	private String stopFlag;		// 停用标识
	private String delFlag;		// 删除标识

	public TcusPresc() {
		this(null);
	}
	
	public TcusPresc(String id){
		super(id);
	}
	
	@JsonSerialize(using = ToStringSerializer.class)
	public Integer getTid() {
		return tid;
	}

	public void setTid(Integer tid) {
		this.tid = tid;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm")
	public Date getBusinessDate() {
		return businessDate;
	}

	public void setBusinessDate(Date businessDate) {
		this.businessDate = businessDate;
	}
	
	@Size(min=0, max=32, message="创建医生工号长度不能超过 32 个字符")
	public String getCreateDrId() {
		return createDrId;
	}

	public void setCreateDrId(String createDrId) {
		this.createDrId = createDrId;
	}
	
	@Size(min=0, max=100, message="创建医生姓名长度不能超过 100 个字符")
	public String getCreateDrName() {
		return createDrName;
	}

	public void setCreateDrName(String createDrName) {
		this.createDrName = createDrName;
	}
	
	@Size(min=0, max=32, message="处方编号长度不能超过 32 个字符")
	public String getPrescNum() {
		return prescNum;
	}

	public void setPrescNum(String prescNum) {
		this.prescNum = prescNum;
	}
	
	@Size(min=0, max=32, message="客户id长度不能超过 32 个字符")
	public String getCusId() {
		return cusId;
	}

	public void setCusId(String cusId) {
		this.cusId = cusId;
	}
	
	@Size(min=0, max=2, message="停用标识长度不能超过 2 个字符")
	public String getStopFlag() {
		return stopFlag;
	}

	public void setStopFlag(String stopFlag) {
		this.stopFlag = stopFlag;
	}
	
	@Size(min=0, max=2, message="删除标识长度不能超过 2 个字符")
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}
	
}